Monitoring Livestock

ABSTRACT

An apparatus for raising livestock includes one or more confinement pens together with alleyways for transfer of the animals from one location to another. The apparatus includes one or more cameras for obtaining images of all animals in the containment area. A processor is provided for analyzing the images, the processor being arranged to allocate an arbitrary identification to each animal and to track all animals continually to maintain the allocation. From this tracking various data related to individual animals or the animals as a group can be obtained to assess their characteristics and to provide an indication to the worker of the animal to be extracted. The processor can be arranged to detect by image analysis of the image a quantity of feed and/or water in a feeder and to obtain images of the farrowing pen including the sow confinement area and at least one piglet confinement area.

This application claims the benefit under 35 USC 119 (e) of Provisionalapplications 62/746,790 filed Oct. 17, 2018, 62/748,774 filed Oct. 22,2018 and 62/848,942 filed May 16, 2019 the disclosures of which areincorporated herein by reference

This invention relates to an apparatus for raising livestock whichincludes a confinement pen and more particularly to components whichallow monitoring of the animals in the pen. In some arrangements thiscan be used for determining changes in behavior which might beassociated with a change in characteristics of the animal. While theapparatus can particularly be used where the animals are raised forslaughter, the apparatus can also be used for animals can be raised formilk or eggs.

The arrangement herein is primarily designed for use with pigs andpoultry production where the animals are typically very tightly confinedin an indoor barn but can be used for any animal husbandry. The term“animal” is of course intended to include poultry.

Hog production and poultry production has typically been carried outwhere the animals are typically very tightly confined in an indoor barn.Skilled workers have to date managed the animals by observation andcontrols. However it is desirable to provide technological assistance toidentify and monitor the animals and their activities including feeding.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide an apparatus forraising livestock which includes an arrangement for monitoring theanimals and their activities.

According to a first aspect of the invention there is provided anapparatus for raising livestock comprising:

at least one first confinement pen defining a confinement area in whicha group of members of the livestock are contained;

a camera system including one or more image generating cameras, thecamera system being mounted at the confinement area and arranged toobtain one or more images of all parts of the confinement area in whichthe members of the group of livestock may enter;

the camera system being arranged to repeatedly obtain said one or moreimages so that all of the members of the group of livestock in theconfinement area are visible in said at least one image at all times;

and a processor for analyzing the images;

wherein the processor uses the images to continually track each of themembers and distinguish each member from the other members.

This arrangement is therefore particularly designed for use in a barnwhere the animals are held together in groups rather than in individualpens.

In this arrangement one important independent features is that theprocessor is arranged to allocate to each of the members of the group oflivestock in said one or more image an individual designation. Theindividual designation is preferably arbitrary so as to be independentof any physical or identification markings of the members of the groupof livestock. Preferably the processor continually tracks each of themembers and distinguishes each member from the other members by watchingand tracking all members at all times. That is preferably the processoroperates to generate data relating to movements of the individualmembers without having to mark or identify the individual members.

In this arrangement one important independent features is that theprocessor is arranged to use periodically data from an outside systemthat identifies the members to check and confirm that a member iscorrectly identified. Thus, in the event that a confusion between twomembers is detected, the processor can operate to identify which membershave been confused and reallocate the data collected to those respectivemembers.

In this arrangement one important independent features is that theprocessor operates to check and confirm when the member is at a specificlocation in the confinement pen such as a feeding station.

In this arrangement one important independent features is that theprocessor is arranged to provide an indication on a display device to aworker identifying a specific designated member. For example theprocessor may provide an indication to the worker by defining anidentification number. Alternatively the processor may provide anindication to the worker by indicating to the worker in which pen of aplurality of pens forming the confinement area the member is located sothat the worker is able to identify the member with his experiencedeyes.

Yet further, the processor may communicate an identification of a memberto a marking component that operates to mark the identified member.

Yet further, the processor may provide to the worker an interactive mapof the confinement area in order to identify where an identified one ofthe members is located in real-time.

According to another feature of the invention there is provided anapparatus for raising livestock comprising:

at least one confinement pen defining a confinement area in which agroup of animals of the livestock are contained;

a camera system including a at least one image generating cameraarranged to obtain one or more images of the animals;

and a processor for analyzing the images;

a plurality of ear tags for mounting on the animals each tag havingthereon a visible image which contains information for identifying therespective animal;

the processor being arranged to detect by image analysis of the imagethe information identifying the animal and thereby determine a locationof the animal within the confinement pen.

Preferably each animal has two ear tags each tag containing the imagefor identifying the respective animal but system using only one tag canbe suitable

Preferably the visible image containing the information identifying theanimal comprises a tag number which is readily readable by a worker inthe pen. having a numerical symbol thereon or alphanumeric symbols.However QR codes and other machine readable information can be includedor can be used instead of alpha numeric codes.

Preferably there is provided at least one feeder having at least onefeed dispensing trough for feed and/or water within the confinement penand wherein the processor is arranged to identify an animal at thefeeder.

In this case there can be provided a control system for controllingsupply of feed and/or water to the trough of an amount or content whichis tailored to the animal identified by said information.

In some cases, each animal may have two ear tags each tag having thenumerical symbol thereon or the alphanumeric symbols for identifying therespective animal.

Preferably the tag number is readily readable by a worker in the pen sothat the number is not a bar code or other electronically decodablepattern.

According to another aspect of the invention there is provided anapparatus for raising livestock comprising:

at least one first confinement pen defining a confinement area in whicha group of animals of the livestock are contained;

at least one feeder device having at least one feed dispensing troughfor feed and/or water with an area for feeding one of the animals;

a camera system including at least one camera mounted at the feeder andarranged to obtain images of the feeder;

and a processor for analyzing the images;

wherein the processor is arranged to detect by image analysis of theimage a quantity of feed and/or water in the feeder.

In some cases the system is used at a feeder having at least one feeddispensing trough for feed and/or water within the confinement pen andthe processor is arranged to identify an animal at the feeder using thetag reading system.

In some cases there is provided a control system for controlling supplyof feed and/or water to the trough of an amount or content which istailored to the animal identified from the tag number. Although the samesystem can be used without such tailored feeding system.

When used at or with the feeder, the camera system can include a cameraobtaining images of the trough and wherein the processor is arranged todetect by image analysis of the image a quantity of feed and/or water inthe trough to determine whether the amount is within operating limitsand to provide a signal in the event that the amount is outside theoperating limits.

That is for example the processor can be arranged to detect by imageanalysis of the image a quantity of feed in the trough.

In some cases the feeder can be of the type which includes a watersupply nipple for supplying water to the trough and the processor isarranged to detect by image analysis of the image whether the trough isfilled with water or contains no water thus indicating a malfunction ofthe nipple.

In some cases when used with the feeder there is provided an animalguidance system controlling approach of the animals to the feeder sothat each animal in turn is controlled by the guidance system and guidedto the feeder to take feed and/or water and in this case the camera canbe located to obtain images of the animal at the guidance system to readthe tag to obtain the identity of the animal and if required tailor thefeed to the identified animal.

In this arrangement, another important independent feature is that theprocessor can arranged to detect an amount of feed remaining in thetrough after the particular animal has left the trough and to subtractfrom an amount of feed to be supplied to the trough for a next animal atthe trough from an amount tailored for the next animal. That is, if afirst animal chooses not to take a the supplied amount of the feedselected for that animal leaving a proportion in the trough, the systemcan detect that amount which remains and can deposit into the trough anamount which takes into account that remaining amount so that the nextanimal only receives the amount it is due to receive and not an extraamount caused by the previous animal leaving some feed. Also the amountleft can be recorded and fed as an extra amount to the first animal whenthat animal returns to the feeder. In this way the amount of feedactually taken by the animals can be better monitored and controlled sothat each animal receives the total amount over a time period to meetsits requirements.

In one important independent feature, the feeder is arranged to dispensea required quantity of feed to the animal in a plurality of doses andwherein the processor is arranged to detect whether a previous dose hasbeen taken by the animal before dispensing another dose.

Using the tag reading system, in some cases the processor can bearranged also to provide output data relating to movement of a specificidentified animal within the confinement pen.

In some cases the using the tag reading system, the processor can bearranged to provide an output indicative of the animal at a givenposition in the pen and feed that information to a tracking system.

On example of use of the tracking system thus defined is that there canbe provided a pen containing a male animal and the processor is arrangedto provide an output indicative of estrus in an identified animal bydetecting the frequency at which a female visits the male.

In another use of the system, the processor can also be arranged todetect by image analysis a calculated weight of the identified animal.This can be used to monitor weight gain both to determine market weightand to tailor feed to maximize feed uptake efficiency.

The systems disclosed herein can be used with feeders both of the typethat have multiple spaces for feeding multiple pigs at the same timewith connected troughs and single dedicated feeders typically but notnecessarily used with tailored feed to the identified animal.

The tag reading can be mostly useful for animal identification aroundfeeders and drinkers, but it could also be used at other locations forwhich it is desired to identify the individual animal for taking otherindividual decisions or get other individual data. One such applicationis estrus detection from monitoring the frequency at which the sow inpen housing visits the boar pen. Another example could be to simplyidentify the animal at a given position in the pen and feed thatinformation to a tracking system.

Trough monitoring can also be used not only for tailoring the diet foreach individual animal. It can also be used to raise alerts to workersin case a trough is empty when it should have some feed, that is thefeeding system may not have worked properly. It could also be used toidentify water nipple problems if the trough is full of water forinstance or empty of water. These two examples could happen even innon-individual feeding settings such as with feeders that have multiplespaces for feeding multiple pigs at the same time with connectedtroughs.

The systems herein also disclose an apparatus for raising livestockcomprising:

at least one first confinement pen defining a confinement area in whicha group of members of the livestock are contained;

a camera system including one or more image generating cameras, thecamera system being mounted at the confinement area and arranged toobtain one or more images of all parts of the confinement area in whichthe members of the group of livestock may enter;

the camera system being arranged to repeatedly obtain said one or moreimages so that all of the members of the group of livestock in theconfinement area are visible in said at least one image at all times;

and a processor for analyzing the images;

the processor being arranged to allocate to each of the members of thegroup of livestock in said one or more image an individual designation;

wherein the individual designation is arbitrary so as to be independentof any physical or identification markings of the members of the groupof livestock;

and wherein the processor continually tracks each of the members anddistinguishes each member from the other members by watching andtracking all members at all times.

Preferably the processor operates to generate data relating to movementsof the individual members entirely without having to mark or otherwiseidentify the individual members and to provide a system which isresponsive to the identification. It will be appreciated that, even ifthere is a marking system used in the group to tag or mark animals, thearrangement described herein can and typically does operate without theneed ever to consult that system. However in some cases the processor isarranged to use periodically data from an outside system that identifiesthe members to check and confirm that a member is correctly identified,as some errors can occur.

In this case, in the event that a confusion between two members isdetected, the processor is arranged to identify which members have beenconfused and reallocate the data collected to those respective members.Thus the processor can operate to check and confirm the identificationwhen the member is at a specific location in the confinement pen such asa feeding station.

Preferably, in order that the worker can take action on a particularlyidentified animal which might be sick or in estrus, the processor isarranged to provide an indication to a worker identifying a specificdesignated member of the group. This can be done in a number ofdifferent ways depending on the mode of operation of the system.

In one example where the system works in combination with a separatesystem which identifies the animals as set forth above, the processorcan provide an indication to the worker by defining an identificationnumber from the separate identification system which can be identifiedby the worker and the animal with that number found.

In another system the processor provides an indication to the worker byindicating to the worker in which pen of a plurality of pens forming theconfinement area the member is located so that the worker is able toidentify the member with his experienced eyes. In this arrangement, thetotal number of animals in the confinement area are separated intoindividual pens of a few animals so that the identification of the penis sufficient to allow the worker to use his experience to locate theanimal showing the signs of the condition detected.

In yet another arrangement, the processor communicates an identificationof a member with component that operates to mark the identified member,for example at a feeding station, using a colored or visual indicationmarker. Thus for example a paint dabber or spray can be located at thefeeder station and operated when the animal concerned is at the station.

Still further in another arrangement, the processor is arranged toprovide to the worker an interactive map of confinement area in order toidentify where the identified member is located in real-time.

Preferably the processor is arranged to generate for each member one ormore of the following sets of data:

Position of each member which can be obtained continually in real timeor can be established by repeated periodic analysis of the data toprovide periodic information about the position.

Velocity of each member which again can be continuous or periodic.

Posture of different parts of the member (whole body, head, tail, etc.)which again can be continuous or periodic.

Energy level of the member which again can be continuous or periodic.

Preferably the processor is arranged to generate for a subgroup of themembers one or more of the following sets of data:

Energy level of the subgroup of members which again can be continuous orperiodic.

Average velocity of the subgroup which again can be continuous orperiodic.

The confinement area can be, in an important independent aspect of theinvention herein, subdivided into different areas including a feedingarea a drinking area, a rest area and the data relating to all of theanimals in these areas can be analyzed to get individual or group datafor any one of these specific areas. In view of the different activitiesof the animals in these areas, analysis of the behavior of the animalswhen in these areas can reveal information about the condition of theanimals which would not be determined by an analysis of their averageactivities when moving throughout the confinement area.

In addition, the data obtained can be, in an important independentaspect of the invention herein, used by detecting the envelope of theimage or by analyzing specific marking within the image to estimate theweight from each animal with the same camera system and assign thisweight to the animal that is being tracked with our system. Othermetrics, in an important independent aspect of the invention herein,such as body condition, fighting marks, etc. can also be obtained. Thesewill not be obtained from behavior metrics, but will use the samecameras to detect the envelope of the image and/or markings within theimage and can also be associated to a specific animal.

The data from these analyses for each of the animals of the group can beused to detect diseases, management problems, climate control problems,reproduction events, aggression events, etc.

Preferably the confinement area comprises a pen or a set of pens inwhich the livestock remain contained until required to be transportedfor transfer as part of a purchase of the group.

Preferably the confinement pen includes one or more feeding systems sothat the livestock remain contained in the pen.

Preferably the processor is arranged for analyzing the images from theconfinement pens to generate a detected number or count of the livestockin the confinement area. Where the area is formed by a series ofindividual pens the processor is arranged for analyzing the images fromthe plurality of confinement pens to generate detected number oflivestock in the group in each respective confinement pen and also actsto repeatedly generate inventories containing the detected number oflivestock in each pen and the detected number of the total of livestockin all the pens in the confinement area so that the number of livestockextracted and the number of livestock transferred from one pen toanother pen are included in the inventories.

In this way preferably the processor automatically provides an inventoryof livestock removed from the pens to be extracted such as when dead ofseriously ill and the number of livestock transferred from one pen toanother pen and livestock added to the pens.

Preferably the inventory comprises an accounting document for use inpurchase of the group.

In many cases the confinement area is larger than can be imaged by asingle camera and wherein a plurality of cameras is provided with theimages being integrated to allow counting of the total number oflivestock in the pen.

Preferably the camera is mounted on a ceiling of the confinement area ata fixed position.

Preferably the camera is removable from its mount and communicateswirelessly so can be moved to another mount at another pen.

Preferably the processor is able to distinguish humans from thelivestock.

Typically but not necessarily the livestock comprises pigs or poultry.

The arrangement described herein also can be used in an apparatus forraising livestock comprising:

a plurality of confinement pens in which groups of the livestock arecontained;

an alleyway connected to and extending between the confinement pens;

so that workers are allowed to remove livestock from the confinementpens either to be extracted from the pens or to be transferred from oneto another of the confinement pens;

each of the confinement pens having least one camera mounted thereat sothat all of the group of livestock in the respective confinement penscan be captured on at least one image;

and a processor for analyzing the images from the confinement pens, theprocessor being arranged to generate an detected number of livestock inthe group in each respective confinement pen;

and repeatedly generating inventories containing the detected number oflivestock in each pen and the detected number of the total of livestockin all the pens so that the number of livestock extracted and the numberof livestock transferred from one pen to another pen are included in theinventories.

The arrangement described herein also can be used in an apparatus forraising livestock comprising:

a confinement pen in which a group of the livestock is contained;

wherein the confinement pen comprises a pen in which the livestockremain contained until required to be transported for transfer as partof a purchase of the group;

the confinement pens having least one camera mounted thereat so that allof the group of livestock in the confinement pen can be captured on atleast one image;

a processor for analyzing the images from the confinement pen, theprocessor being arranged to generate an detected number of livestock inthe group in the confinement pen;

wherein the pen is larger than can be imaged by a single camera andwherein a plurality of cameras is provided with the images beingintegrated to allow counting of the total number of livestock in thepen.

The arrangement described herein also can be used in a method forraising livestock comprising:

containing the livestock in at least one pen;

removing livestock from the confinement pen either to be extracted fromthe pen or to be transferred to another confinement pen and addinglivestock into the pen;

mounting at least one camera mounted at the pen so that all of thelivestock in the confinement pens can be captured on at least one image;

analyzing the images from the confinement pen, the processor beingarranged to generate an detected number of livestock in the confinementpen;

and repeatedly generating inventories containing the detected number oflivestock in said at least one pen so as to automatically provide aninventory of livestock removed from the pen to be extracted and thenumber of livestock transferred from one pen to another pen andlivestock added to the pen.

It will be appreciated that the invention herein can be expressed as amethod or as an apparatus and that all definitions herein can be soexpressed.

The inventions defined above can be used with one or more of theoptional or further improvement features set out below and each may beused independently or in combination with any of the other features.

Preferably the portion of the alleyway comprises a full width of thealleyway.

Preferably the confinement pen comprises a pen in which the livestockremain contained until required to be transported for transfer as partof a purchase of the group.

Preferably the confinement pen includes one or more feeding systems sothat the livestock remain contained in the pen. The pen may therefore bedivided into separate sections of resting, feeding and waste but in thearrangement herein, the animals are visible and detected in all of thesections so that they can be tracked throughout.

In a typical arrangement the remote location to which the animals aretransferred though the alleyway comprises a transport container. Howeverthe remote location can comprises another confinement pen.

Preferably the inventory comprises an accounting document for use inpurchase of the group. The inventory can be printed image from theprocessor or may form a display on a suitable screen. However theinventory is a real thing which can be accessed and studied by theworker to provide data for management of the livestock operation.

Preferably the portion of the alleyway has a width such that thelivestock can pass at least two abreast and can turn to move in anopposite direction against the direction of travel without anyrestriction thereto so that when counting is carried out in the alleywaythe processor of the image has to take into account these differentmovements of the animals. Thus the animals are not confined by any partof the alleyway to movement in a single row in a single direction.

Preferably the processor includes a register which counts a firstintermediate number of livestock in an initial group and continues tocount the livestock from a second group to provide both intermediatenumbers and a subsequent total.

Preferably the processor is arranged to generate an alarm after reachinga predetermined number of livestock.

Preferably the system allows to play back a previous counting sessionvideo for quality insurance or in case of dispute resolution.

In this case, the images can be integrated by stitching the images asone bigger image and then analyzing this image. Alternatively the imagesare integrated by analyzing the content of each image independently andthen changing the coordinate system of the different cameras into aglobal coordinate system.

The arrangement herein is designed to address the recurring challenge ofcounting pigs and made it the first tool that automatically and reliablycounts pigs without human intervention. It uses state-of-the-artcomputer vision algorithms to count pigs in real time without evenhaving to think about it.

The arrangement herein provides the first artificialintelligence-powered vision system designed to help pig producers withthe daily task of counting pigs. It is made of one or multiple cameras,a computation module, and a simple smartphone/tablet user interface. Itcan be used in corridors for automatic counting of moving pigs through avirtual line or above pens or other defined areas for instant countingor inventory purposes. The arrangement is designed to address therecurring challenge of counting pigs and made it the first tool thatautomatically and reliably counts pigs without human intervention. Ituses state-of-the-art computer vision algorithms to count pigs in realtime without even having to think about it.

The arrangement uses fixed hardwired cameras or battery-powered mobilecameras that can be easily moved from a counting area to another. Ituses artificial-intelligence algorithms to analyze live video streamsand returns in real-time the number of pigs moving through a virtualline or the instantaneous number of pigs in a designated area. Itssimple mobile user interface allows to easily choose between dynamiccounting or instantaneous counting. When in dynamic counting mode, allpigs going through a virtual line are counted positively and all pigsgoing back are counted negatively. Humans are not detected as pigs andare therefore not mistakenly counted as animals. Through the interface,the user can visualize the counting area and the number of pigs at anytime, register intermediate numbers of pigs, set alarms to ring afterreaching a certain number of pigs, and generate reports about thereception/shipment of the pigs. The system allows to play back the lastcounting session videos for quality insurance or in case of disputeresolution.

The arrangement herein reduces the need to handle animals for countingpurposes, thus improving animal welfare and worker safety. It allowsanimal handlers to better focus on their work and avoid being distractedby the demanding task of counting the animals.

The arrangement herein makes the management of the farm more efficientand precise. It reduces counting mistakes that can lead to disputesbetween the stakeholders of the pork chain. It can also be used tomonitor an entire farm and always have updated inventory numbers athand.

Although easy to use as a standalone system, the arrangement features anopen application programming interface (API) for third parties to usefreely. This allows farm management software companies to easily connectthe system to their own integrated solution and pig producers toseamlessly benefit from automatic real-time inventories withoutmodifying their habits.

In accordance with another aspect of the invention there is provided anapparatus for raising livestock comprising:

a farrowing pen defining a sow confinement area for a sow and at leastone piglet confinement area for piglets born from the sow;

a feeder device having at least one feed dispensing trough for feedand/or water to the sow;

a camera system including at least one camera mounted at the farrowingpen and arranged to obtain images of the farrowing pen including the sowconfinement area and said at least one piglet confinement area;

a processor for analyzing the images;

and an output communication system for communicating to a worker datarelated to information obtained from the images.

In one important embodiment the processor is arranged to obtain from theimages data related to birth of piglet and to provide said data to theoutput communication system. This can be carried out where the data isobtained by observing in the image the presence of piglets in thefarrowing pen. Alternatively the data can be obtained by detectingchanges in positions and/or demeanour of the sow in the farrowing pen.

In one important embodiment the processor is arranged to detect by imageanalysis of the image a quantity of feed and/or water in the feeder.

In one important embodiment the processor is arranged to calculate fromthe images and provide to the worker a body condition score of the sowrepeatedly during a period of residence of the sow in the farrowing pen.The processor can be arranged to modify an amount of feed supplied tothe feeder in response to detected changes in body condition score.

In one important embodiment the processor is arranged to detect by imageanalysis of the image a quantity of feed and/or water in the trough todetermine whether the amount is within operating limits and to provide asignal in the event that the amount is outside the operating limits.

In one important embodiment the feeder is arranged to dispense arequired quantity of feed to the animal in a plurality of doses andwherein the processor is arranged to detect whether a previous dose hasbeen taken by the animal before dispensing another dose.

In one important embodiment the processor is arranged to detect from theimages a location of at least one of the piglets in a crushing positionunderneath the sow. The crushing location can be observed by detecting amissing one of the piglets from the image indicating that one isunderneath the sow. As an alternative there can be provided a sounddetector for detecting a scream from a piglet being crushed and forcommunicating sound data to the processor to provide an indication of acrushed piglet. In this arrangement the processor can be arranged to useboth the sound data and image analysis of the images for providing adetermination of a crushed piglet. Also the processor can be arranged touse the sound data to trigger an analysis of an image to determine thecrushing of a piglet.

BRIEF DESCRIPTION OF THE DRAWINGS

One embodiment of the invention will now be described in conjunctionwith the accompanying drawings in which:

FIG. 1 is schematic plan illustration of a first embodiment of anapparatus according to the present invention.

FIG. 2 is schematic plan illustration of a second embodiment of anapparatus according to the present invention.

FIG. 3 is schematic plan illustration of a third embodiment of anapparatus according to the present invention.

FIG. 4 is schematic plan illustration of a fourth embodiment of anapparatus according to the present invention.

FIG. 5 is a flow chart showing the operation of the processing system inschematic form.

FIG. 6 is a plan view of a feeder of the type where the animals areguided to a single stall type feeder in an orderly line up allowing thestall to be used to tailor feed to the identified animal.

FIG. 7 is a top plan view of a confinement area including the camerasystem of the present invention.

FIG. 8 is a plan view of a farrowing crate using the image analysissystem of the present invention.

In the drawings like characters of reference indicate correspondingparts in the different figures.

DETAILED DESCRIPTION

FIG. 1 shows an apparatus for raising livestock for slaughter with afirst confinement pen 10 in which a group of the livestock are containedand an alleyway 11 for transferring the group of livestock between theconfinement pen 10 and a transport container in a direction of traveltherebetween.

The alleyway is typically relatively complex with doorways 13 and 14into the pen itself and between the alleyway and the exterior of thebuilding where the transport container is located. The alleyway caninclude exterior components 11A outside the doorway 14 to direct theanimals to the container 12.

It will be appreciated that in some cases the animals are directed fromthe container 12 to the pen depending on whether the animals are beingdelivered to a finishing location or from that location to market. Thesystem can also be used to count animals going out of a breeding farm.Then the same animals can be counted again when going into a finishinglocation.

The alleyway has a width such that the livestock can pass at least twoabreast and can turn to move in an opposite direction against thedirection of travel. That is the alleyway is designed to allowtransportation of various equipment so that its dimensions aredetermined by the requirements rather than as a single path for singleanimals to move to the container 12. Thus the animals which are verynervous at this time can be moving in all directions and can turn andrun back if sufficiently troubled.

In order to provide the counting system, a camera 17 is mounted at thealleyway to obtain images of a portion 11B of the alleyway or of thewhole alleyway including any livestock in the alleyway.

A processor 15 is provided for analyzing the images, the processor beingarranged by the method disclosed below to generate an detected number oflivestock in the group which have moved through the alleyway when thegroup has completed the movement from the confinement pen to the remotelocation.

The processor takes into account livestock which are side by side andlivestock which are moving in the opposite direction before alllivestock of the group complete their movement between the confinementpen and the remote location. An output from the processor 15 is providedto and entered into an inventory 16 so that the detected numberpreviously calculated is recorded.

The processor operation goes as follows:

Each animal is detected in a first frame of the video stream with thehelp of a deep neural network (could be a different type of model oralgorithms in the future). A bounding box is drawn around each detectedanimal in the image. For counting animals in pens, we simply report thenumber of animals detected or the average over a few frames. Forcounting in a corridor, continue to the next steps.

Each animal is detected in the second frame as for the first frame.

The algorithm statistically determines which animal bounding boxdetected in the second frame is the most likely associated to eachanimal bounding box of the previous frame. This association can be basedon previous knowledge about animal speed and acceleration, bounding boxsize (related to animal size), similarity between animals, among others.Once association is made, we trace a line between the center of thefirst bounding box and the center of the second.

We repeat the process for subsequent frames and keep track of thedifferent positions of each individual animal where the positions aretaken as center of the bounding boxes which represents in effect thecenter of mass of the animal.

That is the systems herein follow the position of a particular animalwhich is selected in a first image and then tracked throughout itsmovement through the system. In this way it is not necessary toindividually identify the animals by tags or numbers or otheridentifying marks since the actual identity of the animal concerned isnot important, just that a single selected animal be tracked through itsmovement.

One or several virtual counting lines are positioned perpendicular tothe direction of the animals (corridor). Each animal track that crossesa counting line in the direction of counting adds 1 to the counter. Eachanimal track that crosses a counting line in the opposite directionremoves 1 from the counter. We can use several parallel counting linessuch that if a problem happens in previous parts of the algorithm,resulting in an error in the count, it is likely that this problem willnot affect other counting lines.

We statistically choose the final count based on the different countinglines. Different strategies such as maximum, average, democratic vote orothers can be used to get the number of pigs from the result of thecounting lines.

Processing can be done in real time or not. We prefer in real time butcould also be done a posteriori.

Explained method is a currently preferred algorithm. Other algorithmscan be used. We could for instance find a way to track the animalsdirectly without detecting them before.

If the area to be monitored is larger than the field of view of a singlecamera, a plurality of cameras can be arranged to cover the whole area.In that case, an algorithm will take care of integrating the differentimages such that their content is considered to be from a single image.This can be done by stitching the images as one bigger image and thenanalyze this image (animal detection) or by analyzing the content ofeach image (animal detection) independently and then changing thecoordinate system of the different cameras into a global coordinatesystem to perform the next steps.

In FIG. 2 is shown a modified apparatus for raising livestock forslaughter which includes in a barn 20 a plurality of confinement pens 21to 26 in which groups of the livestock are contained. An alleyway 27 isconnected to and extends between the confinement pens so that workersare allowed to remove livestock from the confinement pens either to beextracted from the pens to be discarded outside the barn in the event ofdeath or severe illness or to be transferred from one to another of theconfinement pens.

In order to keep an accurate track of removals and transfers, a countingsystem is provided which repeatedly generates inventories containing thedetected number of livestock in each pen and the detected number of thetotal of livestock in all the pens so that the number of livestockextracted and the number of livestock transferred from one pen toanother pen are included in the inventories. The inventory is thereforeadjusted according to the animals seen in the pens only. This system canuse cameras only in pens without imaging in the alleyways. Howeverimaging in the alleyways to obtain also direct information on thetransfers.

This is done by providing in each of the confinement pens least onecamera 17 so that all of the group of livestock in the respectiveconfinement pens can be captured on at least one image and the processor15 for analyzing the images from the confinement pens, the processorbeing arranged to generate an detected number of livestock in the groupin each respective confinement pen.

In FIG. 3 is shown a modified apparatus for raising livestock forslaughter which includes a barn 30 defining one large confinement pen inwhich a group of the livestock is contained. This arrangement istypically used for poultry where the whole barn is filled with one batchand the livestock in the batch remain contained until required to betransported for transfer as part of a purchase of the group or for deadanimal removal. In this arrangement the pen is larger than can be imagedby a single camera and hence a plurality of cameras is provided with theimages being integrated to allow counting of the total number oflivestock in the pen.

In FIG. 4 is shown a modified version of the apparatus of FIG. 3 forraising livestock which includes the barn 30 or confinement area. Thismay be a single area or may be separated into individual pens eachcontaining a portion of the total number of animals being raised andbeing monitored by the system herein.

Each pen or the single common pen typically includes a feeder system 40,a rest area 41, a waterer 44 and a waste area 42 where the animals movefrom one area to another at their own volition. The processor 15 in thisembodiment not only provides an indication of the inventory or count ofthe number of animals in the confinement area but also a display devicefor displaying the data obtained by the system as discussed hereinafter.

The operation of the processing system is shown in schematic form inFIG. 5. In this operation, the processor receives the stream of imagesof the whole confinement area as indicated at 50. At step 51, theprocessor analyzes the total image firstly to discard or ignorenon-animal components such as stationary objects and humans in the area.

After identifying each of the animals in the area, each is allocated ordesignated an arbitrary identifier as indicated at 52. As stated above,this is not dependent on an actual marker or tag or other identifier onthe animal itself but is allocated arbitrarily by the system so thateach animal has its own identifier which remains with the image of theanimal as it is tracked but is independent of anything associated withthe actual animal.

As shown at step 53 the processor continually tracks each of the animalsand distinguishes each animal from the other animals by watching andtracking all animals at all times. Thus the tracking of the animals isindicated for animal A at 54 and for each of the other animals as AnimalB to Animal X.

Looking only at Animal A, while of course the same process is followedfor each of the other animals but not shown, the processor operates atstep 55 to generate data relating to posture of the animal includinglying and standing but also other postures.

Again in respect of Animal A, the processor operates at step 56 togenerate data relating to movements of the individual members from onelocation to another.

Again in respect of Animal A, the processor operates at step 57 togenerate data relating to body movements of the individual animalseither while stationary or during travelling movements.

Again in respect of Animal A, the processor operates at step 58 togenerate data the specific location of the individual animal.

All of these operation are carried out using the processing stepsdefined above where the envelope and center of mass of the animal aredetected and applied to the image of the area following which changes inthe location of the envelope provide the above data and changes in shapeof the envelope provide data on the body movements.

At step 59, when an external system is used which actively applies amark or identification to the animal, the processor can be arranged touse periodically data from that outside system that identifies themembers to check and confirm that the animal being tracked remainsconsistent and is correctly identified. That is some errors can occuroccasionally where two animals pass very close or lie very close andthen the system confuses one for the other. This can be periodicallychecked if an outside identification system is available since, thearbitrary allocation by the present system can be checked with theactual identifier system of the outside system at times when thelocation of the animal concerned can be confirmed such as at the feedingstation 40. As shown at 68, when an identification error is detected,the information is fed back to the tracking step 53 to re-allocate thecorrect identity to the two confused animals so that their own properlyallocated movements can be tracked as in steps 55, 56, 57 and 58.

As set forth above, the data detected can be used at steps 62, 63 and 64to generated from the raw data of the animal, data related to the ratioover a time period of different postures such as standing or lying, thevelocity of the animal at any time, the amount of energy being expendedby the animal due to body movements and translation movements. Also thesystem at step 65 can generate at any time a map of the currentlocations of all of the animals. At steps 60 and 61 the system takes thecalculated identity and current location of an individual animal whichis then displayed at output display to the worker as indicated at 43.

Thus the display 43 is used by the processor to provide an indication toa worker identifying a specific designated animal for the worker tocarry out a required process on that animal depending on the conditiondetected from the above analysis steps. This can be done by providing anindication to the worker by defining an identification number when thisis obtained from the above outside identification system.

Alternatively the step 61 can be carried out simply where the processorprovides an indication to the worker by indicating to the worker inwhich pen of a plurality of pens forming the confinement area the memberis located so that the worker is able to identify the member visuallysince the condition identified is typically readily visible to thetrained worker who is instructed where generally to look for the animalconcerned.

As a further alternative the processor communicates an identification ofa member with component 70 that operates to mark the identified animal,for example at the feeding station 40. That is the feeding station canrequire individual animals to stand at the station in a predeterminedorientation while feeding so that when the identified animal reachesthat location, it can be marked without confusion with other animals.

As a further alternative, the processor is arranged to provide to theworker an interactive map at step 65 of the confinement area in order toidentify where the identified animals are located in real-time. Thisallow the worker to visually identify the animal to be extracted.

Thus as shown at steps 61 to 64 the processor is arranged to generatefor each member one or more of the following sets of data:

Position of each member at any instant t.

Velocity of each member at any instant t.

Posture of different parts of the member (whole body, head, tail, etc.)at any instant t.

Energy level of the member at any instant t.

Also as shown at step 66, the processor is arranged to generate for asubgroup of the animals one or more of the following sets of data:

Energy level of the subgroup of members at any instant t.

Average velocity of the subgroup at any instant t.

Using the above obtained data, the processor is arranged so that thedata is used to detect diseases, management problems, climate controlproblems, reproduction events, aggression events, etc which can then becommunicated to the worker to take action which may be carried out onthe group as a whole or may require individual animal identification asset out above.

As shown in FIG. 4, the confinement area can be subdivided intodifferent areas including a feeding area a drinking area and a rest areaand the data relating to all of the animals in these areas can beanalyzed as indicated at to get individual or group data for any one ofthese specific area. In view of the different activities of the animalsin these areas, analysis of the behavior of the animals when in theseareas can reveal information about the condition of the animals whichwould not be determined by an analysis of their average activities whenmoving throughout the confinement area.

In addition, the data obtained by detecting the envelope of the image orby analyzing specific marking within the image as shown at step 55. Thiscan be used as indicated at step 70 to estimate the weight from eachanimal with the same camera system and assign this weight to the animalthat is being tracked with the system. Other metrics such as bodycondition, fighting marks, etc. can also be obtained at step 55. Thesewill not be obtained from behavior metrics, but will use the samecameras to detect the envelope of the image and/or markings within theimage and can also be associated to a specific animal. These are thenused at step 71 to output information from the data obtained includingindications of fighting and aggression.

Turning now to the further embodiments shown in FIGS. 6 and 7, there isshown an apparatus for raising livestock which includes the confinementpen 30 defining a confinement area in which a group of animals of thelivestock are contained. The camera system of the type previouslydescribed includes the cameras 72 located generally in the area of theconfinement pen and cameras 73 at the feeder 40. The feeder shown inFIG. 7 is of the multi-compartment type where the animals are notindividually fed but take feed at their own volition from one of thecompartments when it becomes available. The feeder shown in FIG. 6 is ofthe type which includes a single feeder location where the animals arecontrolled to enter along a guidance system 74 with control gates 75which allow one animal at a time to enter with others being confined ina line-up and prevented from interfering with the animal at the stall.

The camera system includes a at least one image generating camera andtypically a series of such cameras 72, 73 and camera 76 at the stall orguidance system all arranged to obtain images of the animals.

The system further includes the processor 15 for analyzing the imagesand a plurality of ear tags, one of which is shown in FIG. 8 formounting on the animals with each tag having a visible numerical numberthereon for identifying the respective animal.

The processor is arranged to detect by image analysis of the imagestaken at the cameras the tag number of the animal to thereby determine alocation of the identified animal within the confinement pen.

Each animal has two of the ear tags shown in FIG. 8 with each tag havingthe same numerical symbol or alphanumeric symbols thereon foridentifying the respective animal. This allows identification of theanimal from either direction depending on how it is standing at thelocation concerned.

The use of the conventional large numbers or alphanumeric symbols on thetag allows the tag number to be readily readable also by a worker in thepen so that the worker can identify and locate a selected animal whenrequired.

The feeder 40 has at least one feed dispensing trough 401 for feedand/or water and a water dispenser 402 for discharging water into thetrough where the nipple is typically animal actuated to supply a desiredamount. The feed and water are typically discharged into the same troughto be taken together but this is not essential in the present inventionand the troughs may be separate or even at different locations.

In FIG. 6 there is provided a control system 761 for controlling supplyof feed by a feed dispenser 762 and/or water by a valve 763 to thetrough of an amount or content which is tailored to the animalidentified from the tag number with the feeder control systemincorporating or being part of the system which identifies the animalsfrom the tags or from their image as previously described.

The processor is arranged to detect by image analysis of the image aquantity of feed and/or water in the trough to determine whether theamount is within operating limits and to provide a signal in the eventthat the amount is outside the operating limits. One particularlyimportant aspect is that the processor is arranged to detect by imageanalysis of the image a quantity of feed in the trough to ensure thatthe system is not empty or mis-functioning. Another key feature is usedwhere the water supply is by way of an animal actuated nipple forsupplying water to the trough where the processor is arranged to detectby image analysis of the image whether the trough is filled with waterindicating a malfunction of the nipple itself or one or more of theanimals introducing too much water as an entertainment rather than afeeding process. That is the presence of too much water can cause theremaining animals to stop feeding which should be corrected as soon aspossible with the present water detection system allowing the worker totake action from a warning signal from the system.

In FIG. 6, the feeder includes the animal guidance system controllingapproach of the animals to the feeder so that each animal in turn iscontrolled by the guidance system and guided to the feeder to take feedand/or water. In this case the camera is located at a suitable positionto obtain images of the animal at the guidance system or at the feederitself since this can be used with the controller of the feeder tomanage the supply to the individual identified.

In this arrangement, the processor is arranged to detect an amount offeed remaining in the trough after the particular animal has left thetrough. The processor 761 then subtracts that amount from an amount offeed supplied to the trough for a next animal at the trough. That is, ifa first animal chooses not to take the supplied amount of the feedselected for that animal leaving a proportion in the trough, the systemdetects that amount which remains and deposits into the trough an amountwhich takes into account that remaining amount so that the next animalonly receives the amount it is due to receive and not an extra amountcaused by the previous animal leaving some feed.

Also in FIG. 6, the feeder 40 is arranged to dispense by the dispenser762 a required quantity of feed to the animal in a plurality of dosesand the processor 761 is arranged to detect from the images whether aprevious dose has been taken by the animal before dispensing anotherdose. In this way the animal takes only feed intended for that animaland the processor 761 can monitor how many doses each animal takes toensure that over time sufficient doses are provided by topping up overtime or by providing data to a worker if the animal continues to take alower number of doses than intended.

In addition, using the whole camera system, the processor is arranged toprovide output data at the display 43 relating to movement of a specificidentified animal within the confinement pen. For example, the processoris arranged to provide an output at the display 43 indicative of theanimal at a given position in the pen and feed that information to atracking system.

As shown in FIG. 7 there is provided a pen 77 containing a male animalat the position and wherein the processor is arranged to provide anoutput at the display 43 indicative of estrus in an identified animal bydetecting the frequency at which a female visits the pen 77.

The same image analysis system as described herein can also be used byprocessor to detect by image analysis of the image a calculated weightof an identified animal.

Turning now to FIG. 8 there is shown an apparatus comprising a farrowingpen 80 which typically is one of a row of such pens each containing asow which is transferred to the pen when birth is expected. The pendefines a sow confinement area 81 for containing the sow and two pigletconfinement areas 82 for piglets born from the sow. The piglet areas arearranged so that the sow is prevented from lying in these areas. Thepiglets remain in the pen from birth through to weaning when all areremoved form the pen for another gestation cycle. A warmer mat orwarming area 83 is provided in the piglet area or areas to attract thepiglets away from the sow area to reduce the risk of crushing. A feeder84 is provided at the front of the sow area with a trough 85 supplied bya feed supply system 86 and a water dispensing nozzle 87 is providedwith a control nipple to allow the sow to take water at will. The supplysystem 86 is preferably arranged to supply a controlled amount of feedto the sow depending on a control program to ensure sufficient intakeper day.

The system further includes a camera system 88 including at least onecamera 89 mounted at the farrowing pen and arranged to obtain images ofthe farrowing pen including the sow confinement area and the pigletconfinement areas.

There is provided a processor 90 for analyzing the images. The processorcan be stand-alone or may be part of another processor carrying outother functions or may be part of a system. This communicates with anoutput communication system 91 for communicating to a worker datarelated to information obtained from the images. This processor or thesystem of which it is a part also communicates to the feeder supplysystem 86. The camera system includes a microphone 92 for receivingsounds from the farrowing crate.

The processor is arranged to obtain the images from the camera and soundfrom the microphone and to carry out image analysis to generateinformation therefrom relating to:

-a- data related to birth of piglet and to provide said data to theoutput communication system.

-b- the presence of piglets in the farrowing pen.

-c- changes in positions and/or demeanour of the sow in the farrowingpen indicative of imminent birth.

-d- a quantity of feed in the feeder.

-e- presence of water at the feeder.

-f- a quantity of feed and/or water in the trough to determine whetherthe amount is within operating limits and to provide a signal in theevent that the amount is outside the operating limits.

-g- a body condition score of the sow which is obtained repeatedlyduring a period of residence of the sow in the farrowing pen.

-h- a location of at least one of the piglets in a crushing positionunderneath the sow.

-i- detecting a missing one of the piglets from the image indicatingthat one is underneath the sow.

-j- a scream from a piglet being crushed and for communicating sounddata to the processor to provide an indication of a crushed piglet.

-k- both the sound data and image analysis of the images for providing adetermination of a crushed piglet by using the sound data to trigger ananalysis of an image to determine the crushing of a piglet.

The processor is arranged to provide an output to the worker either asan immediate call for action warning or as long term data of theconditions above and to modify an amount of feed supplied to the feederin response to detected changes in body condition score.

1. Apparatus for raising livestock comprising: at least one firstconfinement pen defining a confinement area in which a group of membersof the livestock are contained; a camera system including one or moreimage generating cameras, the camera system being mounted at theconfinement area and arranged to obtain one or more images of all partsof the confinement area in which the members of the group of livestockmay enter; the camera system being arranged to repeatedly obtain saidone or more images so that all of the members of the group of livestockin the confinement area are visible in said at least one image at alltimes; and a processor for analyzing the images; wherein the processoruses the images to continually track each of the members and distinguisheach member from the other members; wherein the processor is arrangedfor analyzing the images from a plurality of confinement pens togenerate detected number of livestock in the group in each respectiveconfinement pen and repeatedly generating inventories containing thedetected number of livestock in each pen and the detected number of thetotal of livestock in all the pens in the confinement area so that thenumber of livestock extracted and the number of livestock transferredfrom one pen to another pen are included in the inventories.
 2. Theapparatus according to claim 1 wherein the processor is arranged toallocate to each of the members of the group of livestock in said one ormore image an individual designation.
 3. The apparatus according toclaim 2 wherein the individual designation is arbitrary so as to beindependent of any physical or identification markings of the members ofthe group of livestock.
 4. The apparatus according to claim 1 whereinthe processor continually tracks each of the members and distinguisheseach member from the other members by watching and tracking all membersat all times.
 5. The apparatus according to claim 1 wherein theprocessor operates to generate data relating to movements of theindividual members without having to mark or identify the individualmembers.
 6. The apparatus according to claim 1 wherein the processor isarranged to use periodically data from an outside system that identifiesthe members to check and confirm that a member is correctly identified.7. The apparatus according to claim 1 wherein the processor is arrangedto provide an indication on a display device to a worker identifying aspecific designated member.
 8. The apparatus according to claim 1wherein the processor provides an indication to the worker by definingan identification number.
 9. The apparatus according to claim 1 whereinthe processor is arranged to provide to the worker an interactive map ofthe confinement area in order to identify where an identified one of themembers is located in real-time.
 10. The apparatus according to claim 1wherein the processor is arranged to generate for each member one ormore of the following sets of data: Position of each member Velocity ofeach member. Posture of different parts of the member (whole body, head,tail, etc.). Energy level of the member.
 11. The apparatus according toclaim 1 wherein the processor is arranged to generate for a subgroup ofthe members one or more of the following sets of data: Energy level ofthe subgroup of members. Average velocity of the subgroup.
 12. Theapparatus according to claim 1 wherein said processor automaticallyprovides an inventory of livestock removed from the pens to be extractedand the number of livestock transferred from one pen to another pen andlivestock added to the pens.
 13. The apparatus according to claim 1wherein the inventory comprises an accounting document for use inpurchase of the group.
 14. The apparatus according to claim 1 whereinthe confinement area is larger than can be imaged by a single camera andwherein a plurality of cameras is provided with the images beingintegrated to allow counting of the total number of livestock in thepen.
 15. The apparatus according to claim 1 wherein the camera ismounted on a ceiling of the confinement area at a fixed position. 16.The apparatus according to claim 1 wherein the camera is removable fromits mount and communicates wirelessly so can be moved to another mountat another pen.
 17. The apparatus according to claim 1 wherein theconfinement area is subdivided into different areas including a feedingarea a drinking area and a rest area and the data relating to all of theanimals in these areas can be analyzed to get individual or group datafor any one of these specific areas.
 18. The apparatus according toclaim 17 wherein in view of the different activities of the animals inthese areas, analysis of the behavior of the animals when in these areasreveals information about the condition of the animals which is notdetermined by an analysis of their average activities when movingthroughout the confinement area.
 19. The apparatus according to claim 1wherein the data is used to estimate the weight of each animal andassign this weight to the animal that is being tracked.
 20. Theapparatus according to claim 1 wherein each animal includes at least oneear tag identifying the animal by a human readable, visible alphanumericidentifier and wherein the processor uses the image to read theidentifier.